import request from '@/utils/request'
const baseUrl = '/cz-messaging/api/v1/messages' //系统消息
// import {getMessages } from '@/api/sysMessag/index' 

/*
###
# 消息:查询分页列表
# POST {{baseUrl}}/messages/page
# 过滤条件: 消息标题:msgTitle  是否已读:status 未读: 5 已读:10 
# 创建时间区间: 开始时间:beginCreateDate  结束时间: endCreateDate
*/
export const getMessages = (data:any) => { 
  return request({
    url: baseUrl+'/page',
    method: 'post',
    data: data
  })
}

export const getMessagesList = (data:any) => { 
  return request({
    url: baseUrl+'/list',
    method: 'post',
    data: data
  })
}
/*根据id查询详情
*/
export const getDetailsById = (id) => {
  return request({
    url: baseUrl + '/' + id,
    method: 'GET',
  })
}
/*
根据id查询详情
*/
export const setRead = (data) => {
  return request({
    url: baseUrl + '/setRead',
    method: 'PUT',
    data
  })
}
/*
全部已读
*/
export const setAllRead = (data) => {
  return request({
    url: baseUrl + '/setAllRead',
    method: 'PUT',
    data
  })
}
//批量删除
export const deleteIds = (ids: any) => {
  return request({
    url: baseUrl,
    method: 'DELETE',
    data:ids
  })
}